package com.rongc.client.freight.base.model;

import com.rongc.client.core.utils.DateUtil;
import com.rongc.client.core.utils.StringUtils;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;


/**
 * Created by Bruce on 2017/7/9.
 */
public class ProvinceTimeList {

    private static ArrayList<ProvinceBean> options1Items = new ArrayList<>();
    private static ArrayList<String> options2Items = new ArrayList<>();
    private static ArrayList<String> options3Items = new ArrayList<>();
    private static ArrayList<ProvinceBean> optionsLengthItems = new ArrayList<>();



    public static ArrayList<ProvinceBean> getOptions1Items(){
        options1Items.clear();

        String str1 = DateUtil.getCurrentDate(DateUtil.dateFormatYMD);
        String str2 = DateUtil.getCurrentDateByOffset(DateUtil.dateFormatYMD, Calendar.DAY_OF_MONTH,1);
        String str3 = DateUtil.getCurrentDateByOffset(DateUtil.dateFormatYMD, Calendar.DAY_OF_MONTH,2);
//        str1 = DateUtil.formatDateStr3Desc(str1,DateUtil.dateFormatYMDHMS,DateUtil.dateFormatMD);
//        str2 = DateUtil.formatDateStr3Desc(str2,DateUtil.dateFormatYMDHMS,DateUtil.dateFormatMD);
//        str3 = DateUtil.formatDateStr3Desc(str3,DateUtil.dateFormatYMDHMS,DateUtil.dateFormatMD);
        options1Items.add(new ProvinceBean(0,str1,"今天",""));
        options1Items.add(new ProvinceBean(1,str2,"明天",""));
        options1Items.add(new ProvinceBean(2,str3,"后天",""));


        return options1Items;

    }


    public static ArrayList<String> getOptions2Items(){
        options2Items.clear();
        String hourTemp = DateUtil.getCurrentDate(DateUtil.dateFormatH);
//        int hour = StringUtils.parseInt(hourTemp);
        int hour = 0;
        for (int i = hour;i < 24;i++){
            String tempHour = StringUtils.makeGdPeriod(i);
            for (int j = 0; j< 60;){
                String temp = tempHour + ":" + StringUtils.makeGdPeriod(j);
                options2Items.add(temp);
                j +=30;
            }
        }

        return options2Items;

    }

    // 车型
    public static ArrayList<ProvinceBean> getOptionsModelItems(){
        options1Items.clear();

        List<DicsBean.DicBean> datas = DicsBean.load(BaseDic.DicsType.MODEL_TYPE).getDics();
        for (DicsBean.DicBean bean :
                datas) {
            options1Items.add(new ProvinceBean(0,bean.getKey(),bean.getValue(),""));
        }

        return options1Items;
    }

    // 车长
    public static ArrayList<ProvinceBean> getOptionsLengthItems(){
        optionsLengthItems.clear();

        List<DicsBean.DicBean> datas = DicsBean.load(BaseDic.DicsType.LENGTH_TYPE).getDics();
        for (DicsBean.DicBean bean :
                datas) {
            optionsLengthItems.add(new ProvinceBean(0,bean.getKey(),bean.getValue(),""));
        }

        return optionsLengthItems;
    }

}
